﻿using UnityEngine;
using System.Collections;

[System.Serializable]
public class CardInfo {
	public string name;
	public int startLevel;
	public int attackPower;
	public int defancePower;
	public int attackRange;
	public int hitProbability;
	public int missProbability;

	public MilitaryUnit Instantiate()
	{
		GameObject gameObj = MonoBehaviour.Instantiate( Resources.Load("Unit")) as GameObject;
		gameObj.name = name;
		MilitaryUnit militaryUnit = gameObj.GetComponent<MilitaryUnit> ();
		if (militaryUnit == null){
			militaryUnit = gameObj.AddComponent<MilitaryUnit> ();
		}

		militaryUnit.attribute = this;
		return militaryUnit;
	}
}
